<template>
  <div class="chart-content">
      <div class="item">
        <p>{{buName}}-合同履约滚动报送率</p>
        <i-circle
            v-if="chatData.perfRollRepRate"
            :size="160"
            :trail-width="9"
            :stroke-width="9"
            :percent="toPercentWithoutUnit(chatData.perfRollRepRate)"
            stroke-linecap="square"
            stroke-color="#ffb98c">
            <div class="demo-circle-custom">
                <h1>{{toFixPercent(chatData.perfRollRepRate)}}</h1>
                <div v-if="removeMinusSign(chatData.perfrrrChain)!== ''">
                  <span class="chain">环比</span>
                  <img src="@/asset/images/rise.svg" alt="" v-if="chatData.perfrrrChain > 0">
                  <img src="@/asset/images/fall.svg" alt="" v-else-if="chatData.perfrrrChain < 0" class="fall">
                  <span>{{removeMinusSign(chatData.perfrrrChain)}}</span>
                </div>
            </div>
        </i-circle>
        <div v-else class="no-data">暂无数据</div>
     </div>

     <div class="item">
      <p>{{buName}}-合同支付滚动报送率</p>
      <i-circle
        v-if="chatData.payRollRepRate"
        :size="160"
        :trail-width="9"
        :stroke-width="9"
        :percent="toPercentWithoutUnit(chatData.payRollRepRate)"
        stroke-linecap="square"
        stroke-color="#e37318">
        <div class="demo-circle-custom">
            <h1>{{toFixPercent(chatData.payRollRepRate)}}</h1>
            <div v-if="removeMinusSign(chatData.payrrrChain)!== ''">
              <span class="chain">环比</span>
              <img src="@/asset/images/rise.svg" alt="" v-if="chatData.payrrrChain > 0">
              <img src="@/asset/images/fall.svg" alt=""  v-else-if="chatData.perfrrrChain < 0" class="fall">
              <span>{{removeMinusSign(chatData.payrrrChain)}}</span>
            </div>
        </div>
        </i-circle>
      <div v-else class="no-data">暂无数据</div>
    </div>
  </div>

</template>

<script>
export default {
  props:{
    reportData: {
      type: Object,
      default: () => {},
    },
    buName:{
      type: String,
      default: "华润集团",
    }
  },
  data () {
    return {
      chatData:{}
    }
  },
  
  watch:{
    reportData:{
      handler(newVal) {
        this.chatData = Object.assign({}, newVal);
      },
      deep: true,
      immediate: true
    }
  }
}
</script>

<style lang="less" scoped>
.chart-content {
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  .item{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    p{
      color:"#333";
      font-weight: bold;
      font-size: 16px;
      margin-bottom: 16px;
    }
  }
  .no-data{
    width: 100%;
    height: 100%;
    line-height: 150px;
    text-align: center;
    color: #333;
    font-size: 14px;
  }
  .demo-circle-custom{
    h1{
      font-size: 25px;
      color: #333;
      font-weight: bold;
    }
    div{
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 14px;
      span{
        font-size: 12px;
        color: #000000a5;
      }
      img{
        width: 10px;
        height: 10px;
        margin: 0 5px;
      }
	  .fall{
		  transform: rotate(180deg);
	  }
      .chain{
        margin-right: 5px;
      }
    }
  }
}
</style>
